package cn.edu.neusoft.practice.Controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.edu.neusoft.practice.mapper.ApplyMapper;
import cn.edu.neusoft.practice.po.Apply;

@CrossOrigin
@Controller
public class ApplyController {
	//
	@Autowired
	private ApplyMapper ApplyMapper;
	
	@RequestMapping("/getAllApply")
	@ResponseBody
	public List<Apply> getAllApply(){
		//return ApplyMapper.selectList(null); //针对单表的查询方法
		return ApplyMapper.getApplyWithTelephone();
	}
	
	@RequestMapping("/addApply")//加
    @ResponseBody
    public List<Apply> addApply(Apply a){
      return ApplyMapper.AddApply(a);
    }
	@RequestMapping("/deleteApply")//删
    @ResponseBody
    public int deleApply(int applyId){
      return ApplyMapper.deleteById(applyId);
    }


}
